select formson_0036.ID as "TWOID",formmain_0035.ID,formson_0036.FIELD0032,formson_0036.FIELD0011,formson_0036.FIELD0012,
formson_0036.FIELD0067,formson_0036.FIELD0013,formson_0036.field0014,FORMMAIN_0141.FIELD0002 as "TmType",
formson_0036.FIELD0038,formson_0036.FIELD0035,COL_SUMMARY.id as "Liuc",formson_0036.FORMMAIN_ID as "FId",
ORG_MEMBER.NAME as USERNAME,ORG_UNIT.NAME as DEPTNAME,"temp_org_member_group"."company"as ADDRESS,
formmain_0035.ID as "CID",to_char(formson_0036.FIELD0012,'yyyyMMdd') as "SQRQ",
to_char(formson_0036.FIELD0012,'yyyyMMddHH24MISS') as "JBKSTIME",
to_char(formson_0036.FIELD0013,'yyyyMMddHH24MISS') as "JBJSTIME",
to_char(formson_0036.FIELD0038,'yyyyMMddHH24MISS') as "KQKSTIME",
to_char(formson_0036.FIELD0035,'yyyyMMddHH24MISS') as "KQJSTIME",
formmain_0035.field0002 as "DJLSH",formmain_0035.field0068 as "BT",
formson_0036.ID as "邮箱唯一编号",formson_0036.FIELD0032 as "G-HR职员编号",formmain_0035.ID as "SEQ",
to_char(formson_0036.FIELD0012,'yyyyMMdd') as "申请开始日期",FORMMAIN_0141.FIELD0002 as "加班类型",
to_char(formson_0036.FIELD0012,'yyyyMMddHH24MISS') as "加班开始时间",
to_char(formson_0036.FIELD0013,'yyyyMMddHH24MISS') as "加班结束时间",
to_char(formson_0036.FIELD0038,'yyyyMMddHH24MISS') as "考勤开始时间",
to_char(formson_0036.FIELD0035,'yyyyMMddHH24MISS') as "考勤结束时间",formson_0036.field0014 as "事由"
from formson_0036
left outer join formmain_0035 on formmain_0035.ID=formson_0036.FORMMAIN_ID
left outer join  COL_SUMMARY on formson_0036.FORMMAIN_ID=COL_SUMMARY.form_recordid
left outer join FORMMAIN_0141 on formson_0036.FIELD0011=FORMMAIN_0141.FIELD0001
LEFT outer JOIN ORG_MEMBER ON ORG_MEMBER.CODE = formson_0036.FIELD0032
LEFT outer JOIN "temp_org_member_group" ON ORG_MEMBER.ID = "temp_org_member_group"."member_id"
LEFT outer JOIN ORG_UNIT ON ORG_MEMBER.ORG_DEPARTMENT_ID = ORG_UNIT."ID"
where formson_0036.FORMMAIN_ID=?
AND ORG_MEMBER.IS_ENABLE = 1 AND ORG_MEMBER.IS_DELETED = 0